home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 5658 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.1 KB

  1. Path: news.lpr.carel.fi!usenet
  2. From: Ari Lukumies <aril@cmt.lpr.mail.carel.fi>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: File Based linked list
  5. Date: Tue, 20 Feb 1996 11:00:09 +0200
  6. Organization: Carelcomp Forest
  7. Message-ID: <31298D99.7D0F@cmt.lpr.mail.carel.fi>
  8. References: <Pine.SOL.3.90.960219171637.21117B-100000@eddie>
  9. NNTP-Posting-Host: renoir.cclahti.carel.fi
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 2.0b6a (WinNT; I)
  14.  
  15. Khan Riaz Ahmad wrote:
  16. >         Anyone know how to write a file based linked list... How
  17. > different is it to implement then a regular memory based linked list??
  18. > Any source code would be greatly appriciated... BTW I am a student and I
  19. > need it for an assignment...
  20. > Thanks
  21. > Ray
  22. > U of T Comp Sci
  23.  
  24. The easy way: use the file as you use a linked list in memory. Only, where you use a 
  25. pointer in the memory list, you'd use a file-offset in the file list. Deletion, 
  26. space-reallocation and garbage collection would require a little more work, though :)
  27.  
  28. Later,
  29.  AriL
  30. -- 
  31. All my opinions are mine and mine alone.
  32.